# def pascal_triangle(num):
#     list=[1]
#     if num==1:
#         print(list)
#     elif num>1:
#         for i in range(1,num):
#             list.insert(0,0)
#             for j in range(i):
#                 list[j]=list[j]+list[j+1]
#             print(" "*(8-1*i),end="")
#             print(list)
#
# # print(pascal_triangle(4))
#
# pascal_triangle(4)

def sanjiao():
    list1=[[1]]
    n=int(input("请输入生成的杨辉三角的行数："))
    if n==1:
        print(list1)
    # else:
        # for i in range(2,n):
            # newrow=list1[i-1]
            # newrow.append(0)
            # row = [None] * (i + 1)
            # for j in range(i + 1):
            #     row[j] = newrow[j - 1] + newrow[j]
            # list1.append(row)
            # print(list1)
    else:
        for i in range(2,n):
            list1_temp=list(list1[i-2]).insert(0,0)
            for j in range(len(list1[i-2])+1):
                list1[j]=list1_temp[j]+list1[j-2]
                print(list1[j])


sanjiao()
